HumpUtils =
  # 驼峰转下划线
  hump2Underline: (s) ->
    if not s
      return ''
    s = s.replace(/([A-Z])/g, '_$1').toLowerCase()
    return s

  # 下划线转驼峰
  underLine2Hump: (s) ->
    if not s
      return ''
    s = s.replace /\_(\w)/g, (all, letter) ->
      letter.toUpperCase()
    return s

  # 首字母大写
  UpcaseFirstLetter: (s) ->
    s = s.replace /\b\w+\b/g, (w) ->
      w.substring(0, 1).toUpperCase() + w.substring(1)
    return s

module.exports = HumpUtils